// 泛型类
class LogClass<T> {
	//不能应用于静态成员
	run(value: T) {
		console.log(value);
		return value;
	}
}
let log1 = new LogClass<number>();
log1.run(1);

// let log2 = new Log();
// log2.run(anytype);

// 泛型约束
interface Length {
	length: number;
}
function logExtends<T extends Length>(value: T): T {
	console.log(value, value.length);
	return value;
}
